package com.open.source.rabbit.consumer.config;

import org.springframework.amqp.core.Queue;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author zhanglong and since on 2020/3/27 3:54 下午
 */
@Configuration
public class QueueConfig {
    @Bean
    public Queue directQueue() {
        //第一个参数：消息队列名称
        //第二个参数：消息在队列上是否持久化
        return new Queue("direct_queue", true);  //true 是否持久
    }

    @Bean
    public Queue queueA() {
        return new Queue("fanout.A");
    }

    @Bean
    public Queue queueB() {
        return new Queue("fanout.B");
    }

    @Bean
    public Queue queueC() {
        return new Queue("fanout.C");
    }

    @Bean
    public Queue firstQueue() {
        return new Queue("topic.man");
    }

    @Bean
    public Queue secondQueue() {
        return new Queue("topic.woman");
    }
}
